﻿using Mapster;
using SHZY.Business.Entitys.Dto.customerfile;
using SHZY.Common.Models;
using SHZY.Common.Security;

namespace SHZY.Business.Entitys.Mapper.QmsBusiCustomerFileMapper;

public class Mapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<QmsBusiCustomerFileCrInput, QmsBusiCustomerFileEntity>()
            .Map(dest => dest.FileInfo, src => src.fileInfo.ToJsonString())
        ;
        config.ForType<QmsBusiCustomerFileEntity, QmsBusiCustomerFileInfoOutput>()
            .Map(dest => dest.fileInfo, src => src.FileInfo.ToObject<List<FileControlsModel>>())
        ;
    }
}

